package com.wzp.util.convert;

import com.google.common.collect.Lists;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * list 转转成其他集合
 *
 * @author zhengpeng.wang
 */
public class ConvertForList {

    public static void main(String[] args) {

    }

    // list<map> => map
    private void listMapToMap() {
        List<Map<String, String>> resultMapList = Lists.newArrayList();
        Map<String, String> resultMap = resultMapList.stream()
                .collect(HashMap::new, (map, item) -> map.put(item.get("baseUrl"), item.get("shortUrl")), HashMap::putAll);
    }
}
